longest common substring interview question